package com.zbj.validator.enums;

/**
 * @author weigang
 * @create 2017-04-12
 **/
public enum ResultCode {
	//通用返回码 ，成功为0，其他从1开始,建议每个系统都复制过去
	FAIL("-1", "操作失败"),
	SUCCESS("0", "成功"),
	SERVER_ERROR("1", "服务器内部错误"),
	SERVICE_NOT_FOUND("2", "service not found"),
	METHOD_NOT_FOUND("3", "method not found"),
	PARAMETER_MORE_THAN_ONE("4", "parameter more than one"),
	CALL_SERVICE_ERROR("5", "call service error"),
	PARAM_ILLEGAL("6", "参数非法"),
	PARAM_URLDECODE_ERROR("7", "urldecode param error"),
	DB_ERROR("8", "数据库异常"),
	LIST_DATA_IS_EMPTY("9", "列表参数为空"),;

	private String code;
	private String description;

	public String getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}

	ResultCode(String code, String description) {
		this.code = code;
		this.description = description;
	}

	public String toStr() {
		return "code:" + code + ",description=" + description;
	}

	public String toStr(String detail) {
		return "code:" + code + ",description=" + description + "," + detail;
	}
}
